package com.at.abc.r418;

import java.io.*;
import java.util.Arrays;
import java.util.Comparator;

public class c {

    static int MAXN = 30005;
    static long[] sum = new long[MAXN];
    static int[] a;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);

        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int q = Integer.parseInt(input[1]);

        a = new int[n];
        input = br.readLine().split(" ");
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(input[i]);
        }

        Arrays.sort(a);

        for (int i = 0; i < q; i++) {
            int b = Integer.parseInt(br.readLine().trim());

            long totalTeaBags = 0;
            long x = -1;

            for (int j = n - 1; j >= 0; j--) {
                totalTeaBags += a[j];
                if (totalTeaBags >= b) {
                    x = totalTeaBags;
                    break;
                }
            }
            out.println(x);
        }
        out.flush();
        out.close();
        br.close();
    }

}
